Setup assertion
Reported by Philipp Pirozhkov | November 28th, 2008 @ 11:16 AM
Setup is a block intended to be run before each should block to initialize the data to be tested so that different should statements doesn't clash
Behave.context('List') do
setup do
list = [1,2,3,4]
should('pop a first value') do
list.pop() == 1
should('return its length') do
list.length() == 4
Comments and changes to this ticket
-

Philipp Pirozhkov November 29th, 2008 @ 02:30 PM
- Tag set to core
- State changed from new to open
- Assigned user set to Philipp Pirozhkov
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Behave is a testing framework dedicated to test Reia language and libraries
== Usage
Behave.context('A User instance') do
setup do
user = User.find(~first)
should('return its full name') do
assert('John Doe' == user.full_name)
assert('John' == user.name)
assert('Doe' == user.surname)
should('return its email address') do
'JohnDoe@gmail.com' == user.email
context('with a profile') do
user.profile = Profile.find(~first)
should('return true calling .has_profile?') do
user.has_profile()